package com.cw2.behavioral.interpreter1;

/**
 * 定义组合规则
 */
public class AndExpression1 extends IDCardExpression1 {

    IDCardExpression1 city;
    IDCardExpression1 type;

    public AndExpression1(IDCardExpression1 city, IDCardExpression1 type) {
        this.city = city;
        this.type = type;
    }

    @Override
    boolean interpreter1(String expression) {
        return city.interpreter1(expression) && type.interpreter1(expression);
    }
}
